home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / amibroker186e / install-amibroker < prev    next >
Text File  |  1996-05-05  |  10KB  |  366 lines

  1. ; Installer Script for AmiBroker 1.86
  2. ; Revision 4.
  3. ; May 5th, 1996  Tomasz Janeczko, TJ Productions.
  4. ; $VER: Install-AmiBroker 4 (05 May 1996)
  5. ;
  6.  
  7. ; ********* English strings (default)
  8.  
  9. (set #badkick "I'm sorry, but AmiBroker requires OS 2.04 or better")
  10. (set #welcome (cat "\nAmiBroker 1.86\nHard Disk Install Script Rev 4.\n"
  11.                    "Copyright (C)1995-96 by Tomasz Janeczko\n\n"
  12.                    "This is SHAREWARE product, so if you use it you should register\n\n\n"
  13.                    "ReqTools (C)1991-95 Nico François\n"
  14.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  15.  
  16. (set #destination "Where do you want to install AmiBroker? ( 'AmiBroker' drawer will be created there )" )
  17. (set #programver  "Which version of AmiBroker do you want to install" )
  18. (set #progverhelp (cat "\nAmiBroker - this version is for 68000+ processors and will work on all Amigas.\n\n"
  19.                        "AmiBroker.FPU - this version is for 68020+ and 68882 floating point coprocessor "
  20.                        "or 68040/060. Will work only on accelerated Amigas" ))
  21.  
  22. (set #olddataexist (cat "You have stock database already installed in your 'data' directory\n"
  23.                         "Please select desired action:" ))
  24.  
  25. (set #dataexisthelp (cat "\nOption:'replace old data' will erase all existing stock data and replace them with a new database"
  26.                          "\n\nOption: 'backup old data and install new' will move your old data to separate directory. Then, new data will be installed."
  27.                          "\n\nOption 'leave untouched' won't change anything in your database (no new data will be installed)" ))
  28.  
  29. (set #replace "replace old data")
  30. (set #backup "backup old data and install new")
  31. (set #leave "leave untouched")
  32.  
  33. (set #backupinprogress (cat "Creating backup of your stock database...\n\n"
  34.                             "You'll find it in directory:\n" ))
  35.  
  36. (set #unpacking    "Unpacking AmiBroker program to:\n")
  37. (set #unpackingFPU "Unpacking AmiBroker.FPU program to:\n")
  38. (set #dearchiving  "Dearchiving database and installing files to:\n")
  39. (set #limiting     (cat "Because your Amiga is equiped with small amount of memory (less than 2MB) "
  40.                         "I have to limit the number of quotation in database to 160"))
  41.  
  42.  
  43. ; ********* Polish strings
  44.  
  45. (if (= @language "polski") (
  46.  
  47. (set #badkick "Bardzo mi przykro ale program AmiBroker wymaga systemu w wersji 2.04 lub wyûszej")
  48. (set #welcome (cat "\nAmiBroker 1.86\nSkrypt instalacyjny HD (Rev 4)\n"
  49.                    "Copyright (C)1995-96 by Tomasz Janeczko\n\n"
  50.                    "Program ten to SHAREWARE, chcâc wiëc go uûywaê powinieneô zarejestrowaê sië jako legalny uûytkownik\n\n\n"
  51.                    "ReqTools (C)1991-1995 Nico François\n"
  52.                    "Installer (C)1991-93 Commodore-Amiga, Inc.") )
  53.  
  54. (set #destination "Wskaû dysk lub katalog gdzie chcesz umieôciê AmiBrokera? ( Zostanie tam utworzony katalog 'AmiBroker')" )
  55. (set #programver  "Wybierz jakâ wersjë AmiBrokera chcesz zainstalowaê" )
  56. (set #progverhelp (cat "\nAmiBroker - to wersja na zwykîy procesor 68000.\n\n"
  57.                        "AmiBroker.FPU - to wersja na 68020 z koprocesorem 68882 "
  58.                        "lub teû procesory 68040 i 68060" ))
  59.  
  60. (set #olddataexist (cat "Masz juû zainstalowane dane o spóîkach i notowaniach w katalogu 'data'\n"
  61.                         "Zdecyduj co mam z nimi zrobiê:" ))
  62.  
  63. (set #dataexisthelp (cat "\nOpcja 'zastâp stare notowania nowymi' skasuje dotychczasowe dane i zainstaluje nowe w dotychczasowym podkatalogu 'data'"
  64.                          "\n\nOpcja 'utwórz kopië starych i zainstaluj nowe' przeniesie stare notowania do katalogu 'data_old', a nowe dane zapisze w katalogu 'data'"
  65.                          "\n\nOpcje 'pozostaw stare notowania' nie zainstaluje ûadnych nowych danych, pozostawiajâc tym samym stare dane bez zmian" ))
  66.  
  67. (set #replace "zastâp stare notowania nowymi")
  68. (set #backup "utwórz kopië starych i zainstaluj nowe")
  69. (set #leave "pozostaw stare notowania")
  70.  
  71. (set #backupinprogress (cat "Tworzë kopie starych notowaï...\n\n"
  72.                             "Znajdziesz je w katalogu:\n" ))
  73.  
  74. (set #unpacking    "Rozpakowujë program AmiBroker do katalogu:\n")
  75. (set #unpackingFPU "Rozpakowujë program AmiBroker.FPU do katalogu:\n")
  76. (set #dearchiving  "Rozpakowujë archiwum i instalujë nowe notowania do katalogu:\n")
  77. (set #limiting     (cat "Poniewaû Twoja Amiga jest wyposaûona w niewielkâ iloôê pamiëci (mniej niû 2MB) "
  78.                         "muszë ograniczyê iloôê notowaï w bazie danych do 160"))
  79.  
  80. ))
  81.  
  82. ; ******* main install part
  83.  
  84. ; set up an error cleanup routine
  85. (onerror
  86.         (makeassign "AmiBrokerinstpgm" (safe))
  87. )
  88.  
  89. ; check OS version
  90.  
  91. (if (< (/ (getversion) 65536) 37)
  92.     (
  93.         (message #badkick)
  94.         (exit (quiet))
  95.     )
  96. )
  97.  
  98. ;just started
  99. (complete 0)
  100.  
  101. (message #welcome)
  102.  
  103. (welcome)
  104.  
  105. ;cancel the assign in case of installation restart
  106. (makeassign "AmiBrokerinstpgm" (safe))
  107.  
  108.  
  109. ; get the dest dir for AmiBroker
  110. (set AmiBroker_dest
  111.         (tackon
  112.                 (askdir
  113.                         (prompt #destination)
  114.                         (help @askdir-help)
  115.                         (default @default-dest)
  116.                 )
  117.                 "AmiBroker"
  118.         )
  119. )
  120.  
  121.  
  122. (complete 10)
  123.  
  124.  
  125. ;We now have a valid destination, so tell Installer where AmiBroker will end up
  126. ;so the exit page will be correct.
  127. (set @default-dest AmiBroker_dest)
  128.  
  129. ;
  130. ; Ask which files one wants to have installed
  131. ;
  132. ;
  133.  
  134. (set progver 1)
  135.  
  136. (if (OR (exists "AmiBroker.FPU") (exists "AmiBroker.FPU.lha") )
  137.    (set progver (askoptions
  138.                  (prompt #programver )
  139.                  (help  #progverhelp )
  140.                   (choices
  141.                     "AmiBroker"
  142.                     "AmiBroker.FPU"
  143.                   )
  144.                  (default 3)
  145.                 )
  146.    )
  147. )
  148.  
  149. ;copy program files from source to dest
  150.  
  151. (if (IN progver 0)
  152.  (if (exists "AmiBroker")
  153.    (copyfiles
  154.      (source "AmiBroker")
  155.      (dest AmiBroker_dest)
  156.      (infos)
  157.    )
  158.    (;else
  159.      (working #unpacking AmiBroker_dest )
  160.      (run (cat "lha -qf x AmiBroker.lha " (tackon AmiBroker_dest "/") ) )
  161.    )
  162.  )
  163. )
  164.  
  165. (complete 10)
  166.  
  167. (if (IN progver 1)
  168.  (if (exists "AmiBroker.FPU")
  169.    (copyfiles
  170.      (source "AmiBroker.FPU")
  171.      (dest AmiBroker_dest)
  172.      (infos)
  173.    )
  174.    (;else
  175.      (working #unpackingFPU AmiBroker_dest )
  176.      (run (cat "lha -qf x AmiBroker.FPU.lha " (tackon AmiBroker_dest "/") ) )
  177.    )
  178.  )
  179. )
  180.  
  181. (complete 20)
  182.  
  183. (copyfiles
  184.   (source "AmiBroker.guide")
  185.   (dest AmiBroker_dest)
  186.   (infos)
  187. )
  188.  
  189.  
  190. (complete 30)
  191.  
  192. (copyfiles
  193.   (source "AmiBroker.history")
  194.   (dest AmiBroker_dest)
  195.   (infos)
  196. )
  197.  
  198. (copyfiles
  199.   (source "ReadMe")
  200.   (dest AmiBroker_dest)
  201.   (infos)
  202. )
  203.  
  204. ; delete old data file if exists
  205. (if (exists (tackon AmiBroker_dest "broker.data"))
  206.     (delete (tackon AmiBroker_dest "broker.data"))
  207. )
  208.  
  209.  
  210. (if (exists (tackon AmiBroker_dest "data"))
  211.     (set datmode (askchoice
  212.                   (prompt #olddataexist)
  213.                   (help #dataexisthelp )
  214.                   (default 1)
  215.                   (choices
  216.                      #replace
  217.                      #backup
  218.                      #leave
  219.                   )
  220.                  )
  221.     )
  222. )
  223.  
  224.  
  225. (if (= datmode 1) (
  226.        (makedir (tackon AmiBroker_dest "data_old") )
  227.        (working #backupinprogress (tackon AmiBroker_dest "data_old"))
  228.        (copyfiles
  229.                (source (tackon AmiBroker_dest "data") )
  230.                (dest   (tackon AmiBroker_dest "data_old") )
  231.                (all)
  232.                (nogauge)
  233.        )
  234. ))
  235.  
  236. (complete 40)
  237.  
  238. (makedir (tackon AmiBroker_dest "data") )
  239.  
  240. (if (< datmode 2)
  241.         (if (exists "data")
  242.             (copyfiles
  243.                  (source "data")
  244.                  (dest   (tackon AmiBroker_dest "data") )
  245.                  (all)
  246.             )
  247.             (;else
  248.                  (working #dearchiving (tackon AmiBroker_dest "data"))
  249.                  (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  250.                  (run "lha -qf x abdata.lha AmiBrokerData:" )
  251.                  (makeassign "AmiBrokerData" (safe))
  252.             )
  253.         )
  254.  
  255. )
  256.  
  257.  
  258. (complete 60)
  259.  
  260. (set #freemem (database "total-mem") )
  261.  
  262. (if (< (- #freemem 2000000) 0)
  263.   (
  264.      (working #limiting)
  265.      (makeassign "AmiBrokerData" (tackon AmiBroker_dest "data") (safe))
  266.      (run "ConvertData >NIL: AmiBrokerData: 160" )
  267.      (makeassign "AmiBrokerData" (safe))
  268.   )
  269. )
  270.  
  271. (working)
  272.  
  273. (if (NOT (exists (tackon AmiBroker_dest "broker.portfolio") ) )
  274.     (copyfiles
  275.      (source "broker.portfolio")
  276.      (dest AmiBroker_dest)
  277.     )
  278. )
  279.  
  280. ; copy key-file if exists
  281. (if (exists "broker.key")
  282.     (copyfiles
  283.      (source "broker.key")
  284.      (dest AmiBroker_dest)
  285.     )
  286. )
  287.  
  288. ; copy key-file if exists
  289. (if (exists "broker.arexx")
  290.     (copyfiles
  291.      (source "broker.arexx")
  292.      (dest AmiBroker_dest)
  293.     )
  294. )
  295.  
  296. (complete 70)
  297.  
  298. ; delete old BrokerSymbol font (1.22 and earlier vers) if exists
  299. (if (exists "FONTS:BrokerSym.font")
  300.     (delete "FONTS:BrokerSym.font")
  301. )
  302.  
  303. (if (exists "FONTS:BrokerSym/16")
  304.     (delete "FONTS:BrokerSym/16")
  305. )
  306.  
  307. (if (exists "FONTS:BrokerSym")
  308.     (delete "FONTS:BrokerSym")
  309. )
  310.  
  311. ; copy fonts needed
  312. (copyfiles
  313.   (source "fonts")
  314.   (dest "FONTS:")
  315.   (fonts)
  316.   (all)
  317. )
  318.  
  319.  
  320. (complete 80)
  321.  
  322. (copyfiles
  323.   (source "ARexxDemo.abrx")
  324.   (dest AmiBroker_dest)
  325.   (infos)
  326. )
  327.  
  328. (makedir (tackon AmiBroker_dest "Examples") )
  329.  
  330. (copyfiles
  331.   (source "Examples")
  332.   (dest (tackon AmiBroker_Dest "Examples" ) )
  333.   (all)
  334. )
  335.  
  336.  
  337. (makedir (tackon AmiBroker_dest "Teletext") )
  338.  
  339. (copyfiles
  340.   (source "Teletext")
  341.   (dest (tackon AmiBroker_Dest "Teletext" ) )
  342.   (all)
  343. )
  344.  
  345. (copyfiles
  346.   (source "examples.info")
  347.   (dest AmiBroker_Dest)
  348. )
  349.  
  350. (complete 90)
  351.  
  352. ;un-snapshot the AmiBroker drawer icon
  353. (tooltype
  354.         (dest AmiBroker_dest)
  355.         (noposition)
  356. )
  357.  
  358. ;done with the install
  359. (complete 100)
  360.  
  361. ;cleanup
  362. (makeassign "AmiBrokerinstpgm" (safe))
  363.  
  364. ;and get out
  365. (exit)
  366.